<script> 
 var str1="this ia a test"; 
 var arr=str1.split(" "); 
 var str2=arr.join(","); 
 with(document){ 
 write(str1); 
 write("<br>分割为数组，数组长度"+arr.length+",重新连接如下：<br>"); 
 write(str2); 
 } 
</script>
